<template>
  <div class="mBlog">
       <h2>{{blog.title}}</h2>
       <el-divider/>
       <div class="markdown-body" v-html="blog.content"></div>
  </div>
</template>

<script>
import "github-markdown-css"
import {getNote} from "../../network/Details/note/note";
import {request} from "../../network/request";
export default {
  name: "NoteDetail",
  data(){
    return{
      blog:{
        title:'CPP',
        content:''
      }
    }
  },
  created() {
    let MarkdownIt = require("markdown-it")
    let md = new MarkdownIt()
    console.log(this.$route.query.noteId)
    request({
      url: '/note/' + this.$route.query.noteId,
      method: 'get'
    }).then(res => {
      this.blog =  res.data
      let result = md.render(this.blog.content)
      this.blog.content = result
    })
  }
}
</script>

<style scoped>
.mBlog{
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
  width: 50%;
  min-height: 90%;
  margin:2% auto;
  background-color: white;
  padding: 20px 15px;
}

</style>
